<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('软件版本详情')" />
    <th:block th:include="include :: jsonview-css" />
    <style type="text/css">
        .layui-input-block{padding-top: 10px;min-height:25px}
        .layui-form-item{margin-bottom: 0px;}
        .layui-form-label {
            width: 120px;
            padding: 9px -0px 0px 10px;
        }
        .paramstyle {
            display: block;
            padding: 9.5px;
            margin: 0 0 10px 20px;
            font-size: 13px;
            line-height: 1.42857143;
            color: #333;
            word-break: break-all;
            word-wrap: break-word;
            background-color: #f5f5f5;
            border: 1px solid #ccc;
            border-radius: 4px;
            overflow: hidden;
            height: 320px;
        }
    </style>
</head>
<body  style="line-height:1.3">
<form class="layui-form" id="jobLogForm" style="padding: 5px 20px 10px 30px;">
    <div class="layui-form-item">
        <label class="layui-form-label" >版本号：</label>
        <div class="layui-input-block" th:text="${versioin?.version}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
        <button type="button" th:class="${versioin.deleted == false ? 'layui-btn layui-btn-xs' : 'layui-btn layui-btn-xs layui-btn-danger'}" style="margin-top: 8px;" th:text="${versioin.deleted == false ? '启用' : '禁用'}">
        </button>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">版本描述：</label>
        <div class="layui-input-block"><span class="paramstyle" id="describe" th:utext="${versioin?.describe}"></span>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">版本升级文件：</label>
        <div class="layui-input-block" style="float:right;margin-left:0px;">
            <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
        </div>
    </div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/html" id="barDh">
    <a class="layui-btn layui-btn-xs dhicon dh-edit" th:lay-event="download"><span class="fa_span">下载</span></a>
</script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var fileMark = [[${versioin.guid}]]
    /*]]>*/
</script>
<script type="text/javascript">
    var $,layer,form,table,laydate,element,form,table;//定义layui模块
    layui.use(['layer','jquery','util','element','form','table'], function () {
        $ = layui.$,layer = layui.layer,util = layui.util,element=layui.element,form=layui.form,table=layui.table;
        var tUrl = "/system/fileinfo/list?fileMark="+fileMark+"&fieldName=filePath";
        $.tablelist.init({
            elem: '#dhtable'
            ,url: tUrl
            ,page:false
            ,cols: [[
                {type:'numbers', fixed: 'left'}
                ,{field:'fileName', title: '文件名',align: 'left',width: 280}
                ,{field:'fileSize', title: '大小',align: 'left',width: 100}
                ,{field:'fileType', title: '类型',align: 'left',width: 80}
                ,{field: 'filePath',title: 'filePath',hide:true}
                ,{field: 'guid',title: 'guid',hide:true}
                ,{title: '操作',align: 'center',width:100,templet:'#barDh'}
            ]
            ]
            ,width:620
        });
        //监听工具条
        table.on('tool(ftable)', function (obj) {
            var data = obj.data;
            switch(obj.event){
                case 'download':
                    window.location.href = ctx + "system/fileinfo/download?guid=" + data.guid;
                    break;
            }
        });
    });
</script>
</body>
</html>